/*
 * @Author: zhangweinan
 * @Date: 2022-11-16 09:45:46
 * @LastEditors: zhangweinan
 * @LastEditTime: 2023-04-19 11:26:34
 * @Description: file content
 * @FilePath: \front-end-of-task-center\src\components\Verifition\utils\axios.js
 */
import axios from 'axios'
import { envUrl } from '@/config/env';
const productionUrl = envUrl.replace('/flowable', '/flowable-api');
axios.defaults.baseURL =
  process.env.NODE_ENV === 'production' ? `${productionUrl}` : `${process.env.VUE_APP_BASE_API}`;
const service = axios.create({
  timeout: 40000,
  headers: {
    'X-Requested-With': 'XMLHttpRequest',
    'Content-Type': 'application/json; charset=UTF-8'
  },
})
service.interceptors.request.use(
  config => {
    return config
  },
  error => {
    Promise.reject(error)
  }
)

// response interceptor
service.interceptors.response.use(
  response => {
    return response.data
  },
  error => {
  }
)
export default service
